#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .. import event_type
from utility.odoo_manager import OdooManager

"""保存操作日志"""
def handle_operation_creation(message: event_type.OperationLogEvent) -> int:
    odoo = OdooManager().get_instance()
    data = {
        'name': message.title,
        'content': message.content
    }
    new_id = odoo.env['operation.log'].create(data)
    return new_id
